<?php
class Admin_Form_AddCountryArticle extends Admin_Form_AddArticle {
	public function init() {
		$dataMaper 	= new M_Tool_DataMapper();

		$title 	 = new Zend_Form_Element_Text('title');
		$enTitle = new Zend_Form_Element_Text('en_title');

		$tbcountry = new M_DbTable_Country();
		$country   = new Zend_Form_Element_Select(
				'reference_id',
                 array('label'        => 'Country',
                 	   'required'	 => true,
                 	   'RegisterInArrayValidator' => false,
                       'multiOptions' => $dataMaper->mapKeyValue(
	                       new M_DbTable_Country(),
	                       'id',
	                       'en_name'
                        )
                 		));

		$description = new Zend_Form_Element_Textarea(
				'description',
				array('label' 		=> 'Description'));

		$thumbnail = new Zend_Form_Element_File(
				'thumbnail',
				array('label' => 'Thumbnail'));

		$type = array(
		        M_DbTable_Article::COUNTRY_ARTICLE_TYPE_GENERAL_INFORMATION => 'General Infomation',
		        M_DbTable_Article::COUNTRY_ARTICLE_TYPE_TRAVEL_DESTINATION  => 'Travel Destination',
		        M_DbTable_Article::COUNTRY_ARTICLE_TYPE_TRAVEL_NEWS			=> 'Travel News',
		        M_DbTable_Article::COUNTRY_ARTICLE_TYPE_TRAVEL_TIPS			=> 'Travel Tips'
		        );
		$type 	  = new Zend_Form_Element_Select(
		        'type',
		        array('label'		 => 'Type',
	                  'multiOptions' => $type));

		$this->addElement($enTitle)
			 ->addElement($title)
			 ->addElement($country)
			 ->addElement($type)
			 ->addElement($thumbnail);

		parent::init();

		$this->setLegend('Add new article about country');
		$this->addActionGroup()
			 ->makeup();
	}
}